home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / stdlib / Mem_SetPrintProc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-22  |  1.8 KB  |  62 lines

  1. /* 
  2.  * Mem_SetPrintProc.c --
  3.  *
  4.  *    Source code for the "Mem_SetPrintProc" library procedure.  See memInt.h
  5.  *    for overall information about how the allocator works..
  6.  *
  7.  * Copyright 1988 Regents of the University of California
  8.  * Permission to use, copy, modify, and distribute this
  9.  * software and its documentation for any purpose and without
  10.  * fee is hereby granted, provided that the above copyright
  11.  * notice appear in all copies.  The University of California
  12.  * makes no representations about the suitability of this
  13.  * software for any purpose.  It is provided "as is" without
  14.  * express or implied warranty.
  15.  */
  16.  
  17. #ifndef lint
  18. static char rcsid[] = "$Header: /sprite/src/lib/c/stdlib/RCS/Mem_SetPrintProc.c,v 1.1 88/05/20 15:49:25 ouster Exp $ SPRITE (Berkeley)";
  19. #endif not lint
  20.  
  21. #include "memInt.h"
  22.  
  23. /*
  24.  *----------------------------------------------------------------------
  25.  *
  26.  * Mem_SetPrintProc --
  27.  *
  28.  *    Changes the default printing routines
  29.  *
  30.  * Results:
  31.  *    None.
  32.  *
  33.  * Side effects:
  34.  *    The default printing routine is changed.  Proc must have the
  35.  *    following calling sequence:
  36.  *
  37.  *    int
  38.  *    PrintProc(clientData, format, arg1, arg2, arg3, arg4, arg5)
  39.  *        ClientData clientData;
  40.  *        char *format;
  41.  *    {
  42.  *    }
  43.  *
  44.  *    This is identical to the calling sequence for fprintf (and fprintf is
  45.  *    used as the default print procedure).  The first argument is the
  46.  *    clientData argument passed to this procedure, which need not
  47.  *    necessarily be a (FILE *).  There will never be more than 5 arguments.
  48.  *
  49.  *----------------------------------------------------------------------
  50.  */
  51.  
  52. ENTRY void
  53. Mem_SetPrintProc(proc, data)
  54.     int    (*proc)();        /* Address of new print routine. */
  55.     ClientData    data;        /* Data to be passed to proc. */
  56. {
  57.     LOCK_MONITOR;
  58.     memPrintProc = proc;
  59.     memPrintData = data;
  60.     UNLOCK_MONITOR;
  61. }
  62.